﻿using DAL;
using IService;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Service
{
    public class BiProductService : IBiProductService
    {
        private BiProductDal dal;
        public BiProductService(BiProductDal biProduct)
        {
            this.dal = biProduct;
        }

        public Task<int> CreateAsync(BiProduct data)
        {
            return dal.CreateAsync(data);
        }

        public Task<int> DeleteAsync(long Id)
        {
            return dal.DeleteAsync(Id);
        }

        public Task<List<BiProduct>> GetAllAsync()
        {
            return dal.GetAllAsync();
        }

        public Task<List<BiProductDetailDTO>> GetAllWithDetailsAsync()
        {
            return dal.GetAllWithDetailsAsync();
        }

        public Task<List<BiProductDetailDTO>> GetAllWithDetailsIdAsync(long id)
        {
            return dal.GetAllWithDetailsIdAsync(id);
        }


        public Task<BiCustomer> GetBiCustomersId(long id)
        {
            return dal.GetBiCustomersId(id);
        }

        public Task<BiSupplier> GetBiSuppliersId(long id)
        {
            return dal.GetBiSuppliersId(id);
        }

        public Task<BiProduct> GetByCodeAsync(string id)
        {
            return dal.GetByCodeAsync(id);
        }

        public Task<BiProduct> GetByIdAsync(long Id)
        {
            return dal.GetByIdAsync(Id);
        }

        public Task<GoodsType> GetByTypeIdAsync(long Id)
        {
            return dal.GetByTypeIdAsync(Id);
        }

        public Task<List<WhInventoryDa>> GetInventoryByGoodsId(long id)
        {
            return dal.GetInventoryByGoodsId(id);
        }

        public Task<int> UpdateAsync(BiProduct date)
        {
            return dal.UpdateAsync(date);
        }
        public async Task<List<WarehouseWithLocationsDTO>> GetAllWithLocationsAsync()
        {
            return await dal.GetAllWithLocationsAsync();
        }

        public Task<int> Status(string status, long id)
        {
            return dal.Status(status, id);
        }
    }
}
